<div
    bsModal
    #createOrEditModal="bs-modal"
    class="modal fade"
    tabindex="-1"
    role="dialog"
    aria-labelledby="createOrEditModal"
    aria-hidden="true"
    [config]="{ backdrop: 'static' }"
>
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form
                *ngIf="active"
                #editForm="ngForm"
                novalidate
                (ngSubmit)="save()"
                autocomplete="off"
            >
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="order.id">编辑任务</span>
                        <span *ngIf="!order.id">创建新的任务</span>
                    </h4>
                    <button
                        type="button"
                        class="close"
                        (click)="close()"
                        [attr.aria-label]="l('Close')"
                    >
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <div class="modal-body">
                    <!-- <div class="row">
                        <div class="col-md-6">
                            <label>任務系统id</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="modelPlanSystemId" [ngClass]="{'edited': order.modelPlanSystemId}" [(ngModel)]="order.modelPlanSystemId">
                            </div>
                        </div>
                    </div> -->

                    <div class="row">
                        <div class="col-md-6">
                            <label
                                >任务号
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="taskCode"
                                    [ngClass]="{
                                        edited: createTaskDto.taskCode
                                    }"
                                    [(ngModel)]="createTaskDto.taskCode"
                                    required
                                />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label
                                >图号
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="drawingCode"
                                    [ngClass]="{
                                        edited: createTaskDto.drawingCode
                                    }"
                                    [(ngModel)]="createTaskDto.drawingCode"
                                    required
                                />
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label
                                >图号名称
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="darwingName"
                                    [ngClass]="{
                                        edited: createTaskDto.darwingName
                                    }"
                                    [(ngModel)]="createTaskDto.drawingName"
                                    required
                                />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label
                                >任务数量
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    type="number"
                                    min="1"
                                    class="form-control"
                                    name="TotalQuantity"
                                    [ngClass]="{
                                        edited: createTaskDto.totalQuantity
                                    }"
                                    [(ngModel)]="createTaskDto.totalQuantity"
                                    required
                                />
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label
                                >型号
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="drawingCode"
                                    [ngClass]="{
                                        edited: createTaskDto.modelCode
                                    }"
                                    [(ngModel)]="createTaskDto.modelCode"
                                    required
                                />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label
                                >阶段
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <!-- <input
                                    class="form-control"
                                    name="modelPartName"
                                    [ngClass]="{
                                        edited: createTaskDto.stage
                                    }"
                                    [(ngModel)]="createTaskDto.stage"
                                    required
                                /> -->
                                <select
                                    #tmplCombobox
                                    class="form-control selectpicker"
                                    name="stages"
                                    data-style="btn-info"
                                    [ngClass]="{ edited: createTaskDto.stage }"
                                    [(ngModel)]="createTaskDto.stage"
                                    title="阶段"
                                >
                                    <option value="0">模态</option>
                                    <option value="1">初样</option>
                                    <option value="2">试样</option>
                                    <option value="3">定型</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label
                                >工艺路线
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="drawingCode"
                                    [ngClass]="{
                                        edited: createTaskDto.processRoute
                                    }"
                                    [(ngModel)]="createTaskDto.processRoute"
                                    required
                                />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label
                                >完成时间
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <p-calendar
                                    [(ngModel)]="createTaskDto.dueDate"
                                    [inputStyle]="{ width: '327px' }"
                                    name="dueDate"
                                    dateFormat="yy-mm-dd"
                                    [showIcon]="true"
                                ></p-calendar>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <label
                                >备注
                                <!-- <span class="text-danger">*</span> -->
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="amount"
                                    [ngClass]="{ edited: createTaskDto.remark }"
                                    [(ngModel)]="createTaskDto.remark"
                                />
                            </div>
                        </div>
                    </div>
                    <!--
                    <div class="row">
                        <div class="col-md-6">
                            <label
                                >完成时间
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <p-calendar
                                    [inputStyle]="{ width: '326px' }"
                                    [(ngModel)]="dueDate"
                                    name="dueDate"
                                    dateFormat="yy-mm-dd"
                                    [showIcon]="true"
                                ></p-calendar>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label
                                >路线
                                <span class="text-danger">*</span>
                            </label>
                            <div
                                class="form-group form-md-line-input form-md-floating-label no-hint"
                            >
                                <input
                                    class="form-control"
                                    name="routingLine"
                                    [ngClass]="{ edited: order.routingLine }"
                                    [(ngModel)]="order.routingLine"
                                    required
                                />
                            </div>
                        </div>
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label>任务备注</label>
                        <textarea
                            class="form-control"
                            type="text"
                            name="remark"
                            [ngClass]="{ edited: order.remark }"
                            [(ngModel)]="order.remark"
                            rows="2"
                        ></textarea>
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label>车间备注</label>
                        <textarea
                            class="form-control"
                            type="text"
                            name="workShopRemark"
                            [ngClass]="{ edited: order.workShopRemark }"
                            [(ngModel)]="order.workShopRemark"
                            rows="2"
                        ></textarea>
                    </div> -->
                </div>

                <div class="modal-footer">
                    <button
                        [disabled]="saving"
                        type="button"
                        class="btn btn-default"
                        (click)="close()"
                    >
                        {{ l('Cancel') }}
                    </button>
                    <button
                        type="submit"
                        class="btn btn-primary blue"
                        [disabled]="!editForm.form.valid"
                        [buttonBusy]="saving"
                        [busyText]="l('SavingWithThreeDot')"
                    >
                        <i class="fa fa-save"></i>
                        <span>{{ l('Save') }}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
